package com.ctrip.study.dp.proxy;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class LogInvocationHandler implements InvocationHandler{
	
	private Object target;

	public LogInvocationHandler(Object target) {
		this.target = target;
	}

	@Override
	public void invoke(Object obj, Method method) {
		System.out.println("logger start");
		try {
			method.invoke(target);
		} catch (IllegalAccessException | IllegalArgumentException
				| InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("logger end");
	}
	
	

}
